package com.cskaoyan.javase._1extends._8hidden.example;

import javax.xml.transform.Source;

/**
 * 属性的隐藏举例
 * @since 09:59
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
    public static void main(String[] args) {
        Son s = new Son(100, 200);
        System.out.println(s.num);

        Father fs = new Son(100, 200);
        System.out.println(fs.num);


        Son s2 = new Son(666);
        System.out.println(s2.num);
        Father fs2 = new Son(666);
        System.out.println(fs2.num);

    }
}

class Father {
    int num = 100;

    {
        num = 200;
    }

    public Father(int num) {
        this.num = num;
    }

    public Father() {
    }
}

class Son extends Father {
    int num = 300;

    public Son() {
    }

    public Son(int num, int num1) {
        super(num);
        this.num = num1;
    }

    public Son(int num) {
        this.num = num;
    }
}
